import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { UserMainComponent } from "./user-main/user-main.component";
import { UserProfileComponent } from "./user-profile/user-profile.component";

const routes: Routes = [
  {
    path: "",
    component: UserMainComponent,
    children: [
      { path: "", redirectTo: "profile", pathMatch: "full" },
      { path: "profile", component: UserProfileComponent },
      { path: "**", redirectTo: "write" }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class UserRoutingModule {}
